import { routerMiddleware } from 'react-router-redux'
import createHistory from 'history/createBrowserHistory'
import thunk from 'redux-thunk'; // redux-saga
import logger from 'redux-logger';

// Create a history of your choosing (we're using a browser history in this case)
const history = createHistory()
const historyMiddleware = routerMiddleware(history)

const middlewares = [thunk, historyMiddleware];

if (process.env.NODE_ENV === 'development') {
  //创建中间件logger
  middlewares.push(logger);
}

export default middlewares